package com.ec.system.api.modules.sys.feign;


import com.ec.common.constant.AppConstant;
import com.ec.core.common.core.api.Result;
import com.ec.system.api.modules.sys.dto.SysUserLoginDTO;
import com.ec.system.api.modules.sys.feign.factory.SysUserFeignFallbackFactory;
import com.ec.system.api.modules.sys.vo.SysUserLoginVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;


/**
 * @author Eric Lee
 * @Description: 微服务之间调用的系统用户相关接口
 */
@FeignClient(
        value = AppConstant.APPLICATION_SYSTEM_NAME,
        fallbackFactory = SysUserFeignFallbackFactory.class,
        path = AppConstant.SYSTEM_API_PREFIX  // 接口前缀
)
public interface ISysUserFeign {
    /**
     * api前缀
     * 使用变量后，restKit无法扫描到接口，
     * 开发到时候建议直接在接口上定义接口url
     */
    String API_PREFIX = "/user-feign";

    /**
     * 系统后台用户登录
     *
     * @param sysUserLoginDTO
     * @return
     */
//    @PostMapping(API_PREFIX + "/login")
    @PostMapping("/user-feign/login")
    Result<SysUserLoginVO> sysUserLogin(@RequestBody SysUserLoginDTO sysUserLoginDTO);
}
